let app = getApp()
Component({
    properties: {
 
      },
      data:{
        status: 0,
        nodata:true,
       cur: 0,
       titArr: [ "全部", "待结算", "已结算", "无效" ],
       orderInfo: []
      },
    lifetimes: {
        attached: function () {
          wx.setNavigationBarTitle({
            title:'订单明细'
          })
          this.orderlist()
       }
      },
    methods: {
      curchange:function(e){
        this.setData({
          status:e.currentTarget.dataset.index,
          cur:e.currentTarget.dataset.index,
        })
        this.orderlist()
      },
      orderlist:function(){
        var that=this
        wx.request({
          url: app.globalData.siteroot,
          data: {
            do:'Distribution_getOrderList',
            staff_id:wx.getStorageSync('staff_bind_id'),
            distribution_id:wx.getStorageSync('distribution_id'),
            page:that.data.page,
            status:that.data.status
          },
          success: function(res) {
            if(res.data.data.length>0){
                that.setData({
                  nodata:false,
                  info:res.data.data
                })
            }else{
              that.setData({
                nodata:true
              })
            }
          }
        })
      }
    }
});
